package com.zyl.pts.config.enums;

import lombok.Getter;

/**
 * @Description
 * @Author 翟玉龙
 * @Date 2024/7/7
 */
@Getter
public enum CodeEnums {

    SUCCESS(200, "操作成功"),
    ERROR(500, "系统内部异常"),
    NOT_FOUND(404, "资源不存在"),
    PARAM_ERROR(400, "参数错误"),
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "禁止访问"),
    LOGIN_ERROR(401, "用户名或密码错误"),
    LOGIN_EXPIRED(401, "登录已过期"),
    PAGE_NUM_IS_NOT_NULL(501 , "当前页码不能为空"),
    FIND_RESULT(200, "查询成功"),
    INSERT_SUCCESS(200, "新增成功"),
    REGISTER_SUCCESS(200, "注册成功"),
    USER_LOGIN_SUCCESS(200, "登录成功"),
    USER_LOGOUT_SUCCESS(200, "退出成功"),
    USER_FORGET_PASSWORD_SUCCESS(200, "success"),
    USER_MODIFY_PASSWORD_SUCCESS(200, "修改密码成功"),
    USER_RESET_PASSWORD_SUCCESS(200, "重置密码成功"),
    /*
     * 600 - 699 用户层
     */
    USER_NOT_FOUND(600, "用户不存在"),
    USER_PASSWORD_ERROR(601, "用户密码错误"),
    USER_DISABLED(602, "用户已被禁用"),
    USER_NOT_LOGIN(603, "用户未登录"),
    USER_NOT_AUTHORIZED(604, "用户未授权"),
    USER_EXIST(605, "用户已存在"),
    EMAIL_EXIST(606, "邮箱已存在"),
    PHONE_EXIST(607, "手机号已存在"),
    REGISTER_FAIL(608, "注册失败"),
    USER_NOT_EXIST(609, "用户不存在"),
    PASSWORD_ERROR(610, "密码错误"),
    USER_MODIFY_PASSWORD_CONFIRM_PASS_ERROR(611, "新密码与确认密码不一致"),
    USER_MODIFY_PASSWORD_OLD_PASS_ERROR(612, "旧密码错误");


    private final Integer code;
    private final String msg;

    CodeEnums(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
